package com.marutea.sample.Objects;


import javax.microedition.khronos.opengles.GL10;

import com.marutea.sample.R;
import com.marutea.sample.Objects.Model.GLES;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.opengl.GLUtils;

public class Texture{
	
	
	public static void bindTexture(GL10 gl){
		int mTextureNo;
				
		Bitmap bmp = BitmapFactory.decodeResource( GLES.context.getResources(), R.drawable.mokume2);
		int[] textureNo = new int[1];
		
		gl.glGenTextures(1, textureNo, 0);
		mTextureNo = textureNo[0];
		
		gl.glBindTexture(GL10.GL_TEXTURE_2D, mTextureNo);
		GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bmp, 0);
		
		gl.glEnable(GL10.GL_TEXTURE_2D);
		gl.glTexParameterx(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
		
	}
	
}
